#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H

#include "pluginextension_global.h"
#include "pluginspec.h"
#include "ipluginfactory.h"

class IPluginFactory;
class PluginSpec;

class PLUGINEXTENSIONSHARED_EXPORT PluginManager: public QObject
{

public:
    PluginManager();
    virtual ~PluginManager();

    static PluginManager *instance();

    QString getPluginPath(void);
    void setPluginPath(const QString path);
    QList<PluginSpec *> getPluginsSpec();
    QList<IPluginFactory*> getFactoryList();

    void loadPlugins();

    // Object pool operations
    void addFactoryObject(IPluginFactory *obj);

private:
    QString pluginPath;
    static PluginManager *m_instance;
    QList<IPluginFactory*> m_factories;
    QList<PluginSpec *> m_pluginSpecs;
};

#endif // PLUGINMANAGER_H
